<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Tiezi extends CI_Controller {
 	public function __construct(){
 		parent::__construct();
 		//连接数据库
 		$this->db = $this->load->database ( "default", TRUE );
 		//读取dilicms的配置属性
 		$this->siteData = $this->db->get($this->db->dbprefix('site_settings'))->row_array();
 	}
 	public function index()
 	{
 		$data["getList"]=$this->getList(); //将二维数组赋值给 data数组 的 info 下标变量
 		$this->load->view('tiezi',$data);
 	}
 	public function getList(){
 		$sql="select * from pet_u_m_content,pet_u_c_forum where pet_u_m_content.class=pet_u_c_forum.classid order by id desc limit 6"; //构建SQL
 		//$sql="select * from pet_u_m_content,pet_u_c_forum where pet_u_m_content.class=pet_u_c_forum.classid";
 		$query = $this->db->query($sql); //发送sql字符串，将返回数据(byte)封装为query对象
 		$resData=$query->result_array(); //将query对象封装为二维数组
 		return $resData;
 		//$this->load->view('news',$data);
 	}
 }